{% assign data = section.settings %}
<div class="block_marquee" style="--bg-color: {{data.bg_color}};--text-color: {{data.text_color}};">
  <div class="content flex items-center w-full overflow-hidden {% if data.hover_stop %}marquee--pause-on-mouseover{% endif %}  marquee-direction-{{data.direction}}">
    {% for i in (1..10) %}
      <ul class="list marquee_container" style="--animation-speed: {{data.speed}}s;">
        {% for block in section.blocks %}
          {% if block.text != '' %}
            <li class="list_item box-border mx-10 {% if block.text_hollow %}lk{% endif %}">
              {{block.text}}
            </li>
          {% endif %}
        {% endfor %}
      </ul>
    {% endfor %}
  </div>
</div>

{% schema %}
{
	"class": "block_blogs",
	"is_global": false,
	"icon": "icon-boke",
	"name": {
		"zh_CN": "滚动文本",
		"en_US": "Scroll text"
	},
	"max_blocks": 20,
	"blocks": [
		{
			"name": {
				"zh_CN": "滚动文本",
				"en_US": "Scroll text"
			},
			"type": "item",
			"settings": [
				{
					"type": "card_text_editor",
					"label": {
						"zh_CN": "文本内容",
						"en_US": "Text content"
					},
					"id": "text",
					"default": ""
				},
				{
					"type": "card_switch",
					"label": {
						"zh_CN": "文字是否镂空"
					},
					"default": true,
					"id": "text_hollow"
				}
			]
		}
	],
	"settings": [
		{
			"type": "card_header",
			"label": {
				"zh_CN": "设置",
				"en_US": "Settings"
			}
		},
		{
			"type": "card_select",
			"label": {
				"zh_CN": "滚动方向",
				"en_US": "Scroll direction"
			},
			"default": "left",
			"id": "direction",
			"option": [
				{
					"label": {
						"zh_CN": "靠左",
						"en_US": "To the left"
					},
					"value": "left"
				},
				{
					"label": {
						"zh_CN": "靠右",
						"en_US": "To the right"
					},
					"value": "right"
				}
			]
		},
		{
			"type": "card_slider",
			"label": {
				"zh_CN": "滚动速度",
				"en_US": "Scroll speed"
			},
			"id": "speed",
			"max": 60,
			"min": 1,
			"unit": "s",
			"default": 4
		},
		{
			"type": "card_switch",
			"label": {
				"zh_CN": "鼠标悬停时暂停",
				"en_US": "Pause on mouse hover"
			},
			"default": true,
			"id": "hover_stop"
		},
		{
			"type": "card_header",
			"label": {
				"zh_CN": "颜色设置",
				"en_US": "Color Settings"
			}
		},
		{
			"type": "card_color",
			"id": "bg_color",
			"label": {
				"zh_CN": "背景颜色",
				"en_US": "Background color"
			},
			"default": "#fdf9ee"
		},
		{
			"type": "card_color",
			"id": "text_color",
			"label": {
				"zh_CN": "文本颜色",
				"en_US": "Text color"
			},
			"default": "#333333"
		}
	],
	"default": {
		"settings": {
			"block_title": "",
			"block_detail": "",
			"direction": "left",
			"speed": 15,
			"hover_stop": true,
			"bg_color": "#fdf9ee",
			"text_color": "#333333"
		},
		"blocks": [
			{
				"text": "Write a big bold statement about your brand!",
				"text_hollow": true,
				"block_type": "item"
			},
			{
				"text": "Introduce your latest promotions.",
				"text_hollow": false,
				"block_type": "item"
			}
		]
	}
}
{% endschema %}